home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kmainwindowiface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-14  |  4.4 KB  |  162 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2001 Ian Reinhart Geiser <geiseri@yahoo.com>
  3.  
  4.    This program is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this program; see the file COPYING.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.    Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef KWINDOW_INTERFACE_H
  21. #define KWINDOW_INTERFACE_H
  22.  
  23. #include <dcopobject.h>
  24. #include <qstringlist.h>
  25. #include <qcstring.h>
  26. #include <dcopref.h>
  27.  
  28. class KDCOPActionProxy;
  29. class KDCOPPropertyProxy;
  30. class KMainWindow;
  31.  
  32. /**
  33.  * @short DCOP interface to KMainWindow.
  34.  *
  35.  * This is the main interface to the KMainWindow.  This will provide a consistent
  36.  * DCOP interface to all KDE applications that use it.
  37.  *
  38.  * @author Ian Reinhart Geiser <geiseri@yahoo.com>
  39.  */
  40. class KDEUI_EXPORT KMainWindowInterface : virtual public DCOPObject
  41. {
  42. K_DCOP
  43.  
  44. public:
  45.     /**
  46.     Construct a new interface object.
  47.     @param mainWindow - The parent KMainWindow object
  48.     that will provide us with the KAction objects.
  49.     */
  50.     KMainWindowInterface( KMainWindow * mainWindow );
  51.     /**
  52.     Destructor
  53.     Cleans up the dcop action proxy object.
  54.     **/
  55.     ~KMainWindowInterface();
  56.  
  57.     QCStringList functionsDynamic();
  58.     bool processDynamic(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData);
  59.  
  60.  
  61. k_dcop:
  62.     /**
  63.     Return a list of actions available to the application's window.
  64.     @return A QCStringList containing valid names actions.
  65.     */
  66.     QCStringList actions();
  67.  
  68.     /**
  69.     Activates the requested action.
  70.     @param action The name of the action to activate.  The names of valid
  71.     actions can be found by calling actions().
  72.     @return The success of the operation.
  73.     */
  74.     bool activateAction( QCString action);
  75.  
  76.     /**
  77.     Disables the requested action.
  78.     @param action The name of the action to disable.  The names of valid
  79.     actions can be found by calling actions().
  80.     @return The success of the operation.
  81.     */
  82.     bool disableAction( QCString action);
  83.  
  84.     /**
  85.     Enables the requested action.
  86.     @param action The name of the action to enable.  The names of valid
  87.     actions can be found by calling actions().
  88.     @return The success of the operation.
  89.     */
  90.     bool enableAction( QCString action);
  91.  
  92.     /**
  93.     Returns the status of the requested action.
  94.     @param action The name of the action.  The names of valid
  95.     actions can be found by calling actions().
  96.     @returns The state of the action, true - enabled, false - disabled.
  97.     */
  98.     bool actionIsEnabled( QCString action);
  99.  
  100.     /**
  101.     Returns the tool tip text of the requested action.
  102.     @param action The name of the action to activate.  The names of valid
  103.     actions can be found by calling actions().
  104.     @return A QCString containing the text of the action's tool tip.
  105.     */
  106.     QCString actionToolTip( QCString action);
  107.  
  108.     /**
  109.     Returns a dcop reference to the selected KAction
  110.     @param name The name of the action.  The names of valid
  111.     actions can be found by calling actions().
  112.     @return A DCOPRef for the kaction.
  113.     **/
  114.     DCOPRef action( const QCString &name );
  115.  
  116.     /**
  117.     Returns and action map
  118.     **/
  119.         QMap<QCString,DCOPRef> actionMap();
  120.     /**
  121.     Returns the ID of the current main window.
  122.     This is useful for automated screen captures or other evil
  123.     widget fun.
  124.     @return A integer value of the main window's ID.
  125.     **/
  126.     int getWinID();
  127.     /**
  128.     Copies a pixmap representation of the current main window to
  129.     the clipboard.
  130.     **/
  131.     void grabWindowToClipBoard();
  132. //    bool isHidden();
  133.     void hide();
  134. //    bool isMaximized();
  135.     void maximize();
  136. //    bool isMinimized();
  137.     void minimize();
  138. //    int width();
  139. //    int height();
  140.     void resize(int newWidth, int newHeight);
  141. //    int Xpos();
  142. //    int Ypos();
  143.     void move(int newX, int newY);
  144.     void setGeometry(int newX, int newY, int newWidth, int newHeight);
  145.     void raise();
  146.     void lower();
  147.     void restore();
  148.     void show();
  149.     void close();
  150.  
  151. //    QCStringList getQTProperties();
  152.  
  153. private:
  154.     KMainWindow *m_MainWindow;
  155.     KDCOPActionProxy *m_dcopActionProxy;
  156.     KDCOPPropertyProxy *m_dcopPropertyProxy;
  157. };
  158.  
  159. #endif
  160.  
  161.  
  162.